<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>登录</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<script type='text/javascript' src="js/jquery-3.2.1.js"></script>

<script type='text/javascript'>
	function submitForm(){
			$.ajax({
				type : "POST",
				url : "loginController/unlock",
				data : $('#loginform').serialize(),
				success : function(result) {
					if (result.success) {
						window.location.href = 'loginController/toIndex';
					} else {
						alert(result.msg);
					}
				}
			});
	}
	
	function clearForm() {
		$('#loginform').form('clear');
	}

	//回车登录
	function enterlogin() {
		//判断密码是否为空
		if (document.loginform.password.value == "") {
			return false;
		}

		if (event.keyCode == 13) {
			event.returnValue = false;
			event.cancel = true;
			submitForm();
		}
	}
</script>
<style type='text/css'>
#code {
	font-family: Arial, 宋体;
	font-style: italic;
	color: green;
	border: 0;
	padding: 2px 3px;
	letter-spacing: 3px;
	font-weight: bolder;
}
</style>
</head>

<body onkeydown="enterlogin();">
	<div class="main">
		<div class="login">
			<div class="login-top">
				<img src="images/p.png">
			</div>
			<h1>鑫隆物业管理系统</h1>
			<div class="login-bottom">
				<form method="post" name="loginform" id="loginform" onsubmit="submitForm()">
					<input type="password"
						id="password" name="password" class="password" placeholder="密码"
						required=" "> 
						 <input type="submit" value="解锁">
					<br />
				</form>
				<a href="#"></a>
			</div>
		</div>
	</div>
	<div class="footer">
		<p>www.wuye.com,----鑫隆物业管理系统</p>
	</div>

</body>
</html>
